﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AO.Core.Config;
using System.IO;

namespace AO.Core
{
    /// <summary>
    /// Test? this is for Console Text Translation...
    /// </summary>
    public class ConsoleText
    {
        private string Locale = ConfigReadWrite.Instance.CurrentConfig.Locale;
        /// <summary>
        /// Please do not include language_  in the file name example:  main.txt"
        /// </summary>
        /// <param name="FileName"></param>
        public void TextRead(string FileName)
        {
            try
			{
				StreamReader reader = File.OpenText("Locale\\"+Locale + "\\" + Locale + "_"+FileName);
            	string console_input = null;
            	while ((console_input = reader.ReadLine()) != null) 
            	{
                	Console.WriteLine(console_input);
            	}
            	reader.Close();
			}
			catch(FileNotFoundException fnfex)
        	{
            	Console.WriteLine(fnfex.ToString());
       		}
        	catch(Exception ex)
        	{
            	Console.WriteLine(ex.ToString());
        	}
        }
    }
}
